#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main(){
  pid_t id = fork();
  if(id == 0)
  {
    execlp("ls","ls","-l","-a",NULL);
  }
  int status = 0;
  pid_t t = waitpid(-1,&status,0);
  printf("wait success,exit code = %d\n",WEXITSTATUS(status));
}
